{template 'web/_header'}
{template 'web/finance/tabs'}
 
<div class="panel panel-info">
    <div class="panel-heading">筛选</div>
    <div class="panel-body">
        <form action="./index.php" method="get" class="form-horizontal" role="form" id="form1">
            <input type="hidden" name="c" value="site" />
            <input type="hidden" name="a" value="entry" />
            <input type="hidden" name="m" value="sz_yi" />
            <input type="hidden" name="do" value="finance" />
            <input type="hidden" name="p" value="log" />
            <input type="hidden" name="type" value="{$_GPC['type']}" />
            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">会员信息</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                    <input type="text" class="form-control"  name="realname" value="{$_GPC['realname']}" placeholder='可搜索会员昵称/姓名/手机号'/> 
                </div>
            </div>
             
             <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">充值单号</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                    <input type="text" class="form-control"  name="logno" value="{$_GPC['logno']}" placeholder='可搜索充值单号'/> 
                </div>
            </div>
 
             <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">会员等级</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                       <select name='level' class='form-control'>
                        <option value=''></option>
                        {loop $levels $level}
                        <option value='{$level['id']}' {if $_GPC['level']==$level['id']}selected{/if}>{$level['levelname']}</option>
                        {/loop}
                    </select>
                </div>
            </div>
             <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">会员分组</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                       <select name='groupid' class='form-control'>
                        <option value=''></option>
                        {loop $groups $group}
                        <option value='{$group['id']}' {if $_GPC['groupid']==$level['id']}selected{/if}>{$group['groupname']}</option>
                        {/loop}
                    </select>
                </div>
        
            </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">
                        {if $_GPC['type']==1}提现时间{else}充值时间{/if}</label>
                      <div class="col-sm-2">
                            <label class='radio-inline'>
                                <input type='radio' value='0' name='searchtime' {if $_GPC['searchtime']=='0'}checked{/if}>不搜索
                            </label>
                             <label class='radio-inline'>
                                <input type='radio' value='1' name='searchtime' {if $_GPC['searchtime']=='1'}checked{/if}>搜索
                            </label>
                     </div>
                    <div class="col-sm-7 col-lg-9 col-xs-12">
                        {php echo tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d  H:i', $endtime)),true);}
                    </div>
                         
                </div>
            {if $_GPC['type']==0}
               <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">充值方式</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                       <select name='rechargetype' class='form-control'>
                         <option value='' {if $_GPC['rechargetype']==''}selected{/if}></option>
                         <option value='wechat' {if $_GPC['rechargetype']=='wechat'}selected{/if}>微信</option>
                         <option value='alipay' {if $_GPC['rechargetype']=='alipay'}selected{/if}>支付宝</option>
                         <option value='system' {if $_GPC['rechargetype']=='system'}selected{/if}>后台</option>
                         <option value='system1' {if $_GPC['rechargetype']=='system1'}selected{/if}>后台扣款</option>
                    </select>
                </div>
               </div>
                {/if}
                 <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">状态</label>
                <div class="col-sm-8 col-lg-9 col-xs-12">
                       <select name='status' class='form-control'>
                         <option value='' {if $_GPC['status']==''}selected{/if}></option>
                         <option value='1' {if $_GPC['status']=='1'}selected{/if}>{if $_GPC['type']==0}充值成功{else}完成{/if}</option>
                         <option value='0' {if $_GPC['status']=='0'}selected{/if}>{if $_GPC['type']==0}未充值{else}申请中{/if}</option>
                         {if $_GPC['type']==1}<option value='-1' {if $_GPC['status']=='-1'}selected{/if}>失败</option>{/if}
                         
                    </select>
                </div>
               </div>
              <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label"></label>
                    <div class="col-sm-7 col-lg-9 col-xs-12">
                       <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                         <input type="hidden" name="token" value="{$_W['token']}" />
                          {ifp 'finance.recharge.export|finance.withdraw.export'}
                        <button type="submit" name="export" value="1" class="btn btn-primary">导出 Excel</button>
                        {/if}
                    </div>
                </div>
            <div class="form-group">
            </div>
        </form>
    </div>
</div>
<div class="panel panel-default">
    <div class="panel-heading">总数：{$total}</div>
    <div class="panel-body ">
        <table class="table table-hover">
            <thead class="navbar-inner">
                <tr>
                    <th style='width:220px;'>{if $_GPC['type']==0}充值单号{else}提现单号{/if}</th>
                    <th style='width:120px;'>粉丝</th>
                    <th style='width:120px;'>会员信息</th>
                    <th style='width:120px;'  class='hidden-xs'>微信号</th>
                    <th style='width:120px;' class='hidden-xs'>会员等级</th>
                    <th style='width:120px;'  class='hidden-xs'>会员分组</th>
                    <th style='width:100px;'>{if $_GPC['type']==1}提现金额{else}充值金额{/if}</th>
                    <th style='width:130px;'>{if $_GPC['type']==1}提现时间{else}充值时间{/if}</th>
                    {if $_GPC['type']==0}<th style='width:120px;'>充值方式</th>{/if}
                    <th style='width:120px;'>状态</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {loop $list $row}
                <tr>
                     <td>{if !empty($row['logno'])}
                                {if strlen($row['logno'])<=22}
                                {$row['logno']}
                                {else}
                                recharge{$row['id']}
                                {/if}
                         {else}
                         recharge{$row['id']}
                         {/if}</td>
                    <td><img src='{$row['avatar']}' style='width:30px;height:30px;padding1px;border:1px solid #ccc' /> {$row['nickname']}</td>
                    <td>{$row['realname']}<br/>{$row['mobile']}</td>
                    <td   class='hidden-xs'>{$row['weixin']}</td>
                    <td   class='hidden-xs'>{if empty($row['levelname'])}普通会员{else}{$row['levelname']}{/if}</td>
                    <td   class='hidden-xs'>{if empty($row['groupname'])}无分组{else}{$row['groupname']}{/if}</td>
                    <td>{$row['money']}</td>
                    <td>{php echo date('Y-m-d H:i',$row['createtime'])}</td>
                                            
    {if $_GPC['type']==0}
    <td> 
        {if $row['rechargetype']=='alipay'}
        <span class='label label-warning'>支付宝</span>
        {else if $row['rechargetype']=='wechat'}
        <span class='label label-success'>微信</span>
         {else if $row['rechargetype']=='system'}
         {if $row['money']>0}
        <span class='label label-primary'>后台</span>
        {else}
        <span class='label label-default'>后台扣款</span>
        {/if}
        
        {/if}
    </td>
    {/if}
                    
                    <td>
                        {if $row['status']==0}
                        <span class='label label-default'>{if $row['type']==1}申请中{else}未充值{/if}</span>
                        {else if $row['status']==1}
                        <span class='label label-success'>{if $row['type']==1}成功{else}充值成功{/if}</span>
                        {else if $row['status']==-1}
                        <span class='label label-warning'>{if $row['type']==-1}失败{/if}</span>
                          {else if $row['status']==3}
                        <span class='label label-danger'>{if $row['type']==0}充值退款{/if}</span>
                        {/if}
                    </td> 
                    
                    <td>
                        {ifp 'member.member.view'}
                        <a class='btn btn-default' href="{php echo $this->createWebUrl('member',array('op'=>'detail','id' => $row['mid']));}">用户信息</a>		
                        {/if}
                        {if $row['type']==0 && $row['status']==1}
                              {if $row['rechargetype']=='alipay' || $row['rechargetype']=='wechat'}
                                 {ifp 'finance.recharge.refund'}
                                          <a class='btn btn-danger' onclick="return confirm('确认退款到微信钱包?')" href="{php echo $this->createWebUrl('finance/log',array('op'=>'pay','paytype'=>'refund','id' => $row['id']));}">退款</a>		         
                                 {/if}
                              {/if}
                        {/if}
                        {if $row['type']==1 && $row['status']==0}
                        {ifp 'finance.withdraw.withdraw'}
                        <a class='btn btn-default' onclick="return confirm('确认微信钱包提现?')" href="{php echo $this->createWebUrl('finance/log',array('op'=>'pay','paytype'=>'wechat','id' => $row['id']));}">微信提现</a>		
                        <a class='btn btn-default' onclick="return confirm('确认手动提现完成?')" href="{php echo $this->createWebUrl('finance/log',array('op'=>'pay','paytype'=>'manual','id' => $row['id']));}">手动提现</a>		
                        <a class='btn btn-default' onclick="return confirm('确认拒绝提现申请?')" href="{php echo $this->createWebUrl('finance/log',array('op'=>'pay','paytype'=>'refuse','id' => $row['id']));}">拒绝</a>		
                        {/if}
                        {/if}
                    </td>
                </tr>
                {/loop}
            </tbody>
        </table>
           {$pager}
    </div>
</div>
 
{template 'web/_footer'}
